Get IMAP Messages
AutomatR.Mail.GetIMAPMessages
The "Get IMAP Messages" activity in AutomatR allows you to automate the retrieval of IMAP email messages from a designated server. This activity is part of the Mail Activities Pack, enhancing automation processes related to email management.
Properties
Name | Description |
---|---|
Input | |
Specify the email account from which you want to retrieve the message. String variables containing the email account. | |
Host | Specify the host name as "imap.gmail.com" to establish a connection with the IMAP server. String variables containing the host name. |
Password | Specify the password of the email account used to retrieve the message. String variables containing the password. |
Port | Specify the port used to connect to the email server and retrieve the email message. Integer variables containing the port number. |
Top | Specify the number of email messages to be retrieved from the email server. Integer variables containing the number of messages. |
Use SSL | Specify the SSL encryption type to be used for the connection with the email server. Boolean variables determining whether to use SSL. |
Body Contains | Specify the content that the mail body should contain for the messages to be retrieved. String variables containing the desired content. |
Optional | |
Delay | Enter the wait time in seconds (Example: 5 seconds i.e., 5) to start the activity. Integer variables containing the delay duration. |
Has Attachments | If checked, only retrieve messages with attachments. Boolean variables determining whether to retrieve messages with attachments. |
Mark As Read | If checked, retrieved messages will be marked as read. Boolean variables determining whether to mark messages as read. |
Only Unread | If checked, only retrieve unread messages. Boolean variables determining whether to retrieve only unread messages. |
Subject Contains | Specify the content that the subject line should contain for the messages to be retrieved. String variables containing the desired content. |
Text Output | If checked, retrieve messages as text output. Boolean variables determining whether to retrieve messages as text. |
Output | |
Exception | If an exception occurs while executing a sequence, the exception can be stored in a string variable for further processing. String variables containing the exception message. |
Messages | The retrieved messages are stored as a collection of MailMessage objects. List variables containing the retrieved messages. |
Result | Returns true or false based on the mail message retrieved. Boolean variables indicating the success of the operation. |
How to use:
- Drag and drop the "Get IMAP Messages" activity onto the workflow.
- Configure the properties by specifying the email account, host, password, port, and other optional parameters.
- Execute the workflow to retrieve email messages based on the specified criteria.
- Retrieve the result, exception, and messages for further processing in the workflow.
Example: Consider an example where the "Get IMAP Messages" activity is used to retrieve unread messages with attachments from the email account "example@gmail.com":
Get IMAP Messages:
Email: "example@gmail.com"
Host: "imap.gmail.com"
Password: "your_password"
Port: 993
Top: 5
Only Unread: true
Has Attachments: true
Result: isMessagesRetrieved
Messages: retrievedMessages
In this example, the activity retrieves the top 5 unread messages with attachments from the specified email account and server. The result of the operation (success or failure) is stored in the Boolean variable "isMessagesRetrieved," and the retrieved messages are stored in the list variable "retrievedMessages" for further handling in the workflow.